﻿<UserControl x:Class="YouTubePlaylist.Views.UserCtrl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:SharedLibrary="clr-namespace:Radovici.SharedLibrary;assembly=RadoviciSharedLibrary">
    <UserControl.Resources>
        <SharedLibrary:BooleanToVisibilityConverter x:Key="ToVisibilityConverter" />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White">
        <StackPanel Orientation="Horizontal" Visibility="{Binding IsUserLoggedIn, Converter={StaticResource ToVisibilityConverter}, ConverterParameter=not}">
            <Button Content="Login" Click="OnLoginClicked"/>
            <TextBlock Text="to add tracks" VerticalAlignment="Center" Margin="4,0,0,0"/>
        </StackPanel>
        <StackPanel Orientation="Horizontal" Visibility="{Binding IsUserLoggedIn, Converter={StaticResource ToVisibilityConverter}}">
            <TextBlock Text="Logged in as" VerticalAlignment="Center" Margin="0,0,4,0"/>
            <Button Content="{Binding User.ExternalKey}" Click="OnLoginClicked"/>
            <TextBlock Text="(click to change)" VerticalAlignment="Center" Margin="4,0,0,0"/>
        </StackPanel>
    </Grid>
</UserControl>
